<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery-3.6.0.js"></script>
    <style>
        body{
            background-color: #ff5f7f;
        }
        .boxx{
            width: 100%;
        }
        .box1{
            margin: auto;
            width: 650px;
            height: 100px;
            display: flex;
            justify-content: space-around;
            align-items: center;
            background-color: white;
            margin-top: 10px;
            margin-left: 350px;
            border-radius: 10px;
        }
    </style>
</head>

<body>
   <div class="boxx">
    <h1 style="text-align: center;">彩票开奖公告</h1>
   </div>
</body>

</html>
<script>
    function fn({ url, data, method }) {
        return new Promise((resolve, reject) => {
            $.ajax({
                url,
                data,
                method,
                success: res => resolve(res),
                fail: err => reject(err)
            })
        })
    }
    let fun = {
        url: "http://api.aslegou.top/api/cptypelist",
        data: {},
        method: "get"
    }
    fn(fun).then(res => {
        console.log(res);
        var arr = res.list
        console.log(arr);
        arr.forEach((item, index) => {
            $('body').append(`
            <div class="boxx">
                <div class="box1">
             <img src="./微信截图_20221214075136.png" alt="">
            <div class="box">
            <p>${item.lottery_name}</p>
            <span>${item.remarks}</span>
        </div>
        <span>
            <img src="./WechatIMG510.png" alt="">
            </span>
    </div>
                </div>
            `)
        })
    }, err => {
        console.log(err);
    })
</script>